package tw.rescue.model.slim3.model;

import java.io.Serializable;

@SuppressWarnings("serial")
public abstract class BaseModel implements Serializable {

	// 檢查是否為null值
	public static boolean isNull(Object obj) {
		return obj == null;
	}
	
	// 檢查是否為空值
	public static boolean isBlank(String str) {
		return "".equals(str.trim());
	}
	
	// 檢查是否為null值或空值
	public static boolean isNullOrBlank(Object obj) {
		boolean result = true;
		
		result = isNull(obj);
		if (obj instanceof String) {
			result = isBlank((String) obj);
		}
		
		return result;
	}
	
	// 重設
	public abstract void reset();
	
	// 格式化
	public abstract void format();
}
